import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait

class Test_regist():
    def setup_method(self):
        self.driver = webdriver.Chrome()
        self.driver.maximize_window()
        self.driver.get("http://127.0.0.1/index.php")

    def test01_regist(self):
        self.driver.find_element(By.LINK_TEXT, '注册').click()
        self.driver.find_element(By.ID, 'username').send_keys('18325539630')
        self.driver.find_element(By.CLASS_NAME, 'J_imgcode').send_keys('8888')
        self.driver.find_element(By.ID, 'password').send_keys('wsf123456')
        self.driver.find_element(By.ID, 'password2').send_keys('wsf123456')
        self.driver.find_element(By.NAME, 'invite').send_keys('18325539630')
        self.driver.find_element(By.CLASS_NAME, 'J_btn_agree').click()

        WebDriverWait(self.driver, 9, 0.5).until(lambda x: x.find_element(By.CLASS_NAME, 'layui-layer-btn0')).click()



